<?php include "header.html"; ?>

<div id="main">
<?php if($ts == 'list'){ ?>
<h3>广告列表</h3>
<table cellpadding="0" cellspacing="0">
<tr>
<td width="20">ID</td><td>名称</td><td>调用方式</td><td>管理</td>
</tr>
<?php foreach($ads as $key=>$ad){ ?>
<tr class='odd'>
<td><?php echo $ad['id']; ?></td><td><?php echo $ad['name']; ?></td><td><a href="http://www.77661.cn/cms/index.php?action=view&cid=3&id=7">调用方法</a></td><td class='action'><a href="index.php?action=ads&ts=edit&id=<?php echo $ad['id']; ?>" class='edit'>编辑</a><a href="index.php?action=ads&ts=del&id=<?php echo $ad['id']; ?>">删除</a></td>
</tr>  
<?php } ?>     
</table>
<?php } ?>

<?php if($ts == 'add'){ ?>
<h3>添加广告</h3>
<fieldset>
<form method="POST"  class="jNice" action="index.php?action=ads&ts=add">
<p><label>广告名称：</label><input type="text" class="text-long" name="name" /></p>
<p><label>广告内容：</label><textarea name="content" style="width:600px;height:50px;"></textarea></p>
<input type="submit" value="添加广告" name="" />
</form>
</fieldset>
<?php } ?>

<?php if($ts == 'edit'){ ?>
<h3>编辑广告</h3>
<fieldset>
<form method="POST"  class="jNice" action="index.php?action=ads&ts=update&id=<?php echo $_GET['id']; ?>">
<p><label>广告名称：</label><input type="text" class="text-long" name="name" value="<?php echo $adDate['name'] ?>" /></p>
<p><label>广告内容：</label><textarea name="content" style="width:600px;height:50px;"><?php echo $adDate['content']; ?></textarea></p>
<input type="submit" value="更新广告" name="" />
</form>
</fieldset>
<?php } ?>
</div>

<?php include "footer.html"; ?>